# coding:utf-8

from lib.base_ios import Base

from page.ios import train_select_order_page, train_order_page

__author__ = 'weixin.yuan'


class TrainOrder(Base):
    """我的订单"""
    def __init__(self, method_name):
        Base.__init__(self, methodName=method_name)

        """
        本页元素
        """
        self.btn_list = [
            train_order_page.elements['待出行按钮'],
            train_order_page.elements['待支付按钮'],
            train_order_page.elements['退款单按钮'],
            train_order_page.elements['全部按钮'],
        ]
        self.select_order_btn = train_order_page.elements['订单查询按钮']

        """
        外部页面元素
        """
        self.select_order_input = train_select_order_page.elements['订单输入框']

    def test_train_order(self):
        """我的订单测试"""
        self.open_schema_ios('6016')

        for btn in self.btn_list:
            self.click(btn)

        self.click(self.select_order_btn)
        self.check(self.select_order_input)